/*
 * @Date: 2019-11-06 10:43:30
 * @LastEditors  : peng qiao
 * @LastEditTime : 2020-02-10 12:40:39
 */
const user = {
  namespaced: true,
  state: {
    neighborhoodId: '',
    communityId: '',
    currentUser: {},
    permissions: {},
    roleNames: ''
  },

  mutations: {
    SET_NEIGHBOR_ID(state,neighborhoodId) {
      state.neighborhoodId = neighborhoodId
    },
    SET_COMMUNITY_ID(state,communityId) {
      state.communityId = communityId
    },
    SET_ROLE_NAME(state,roleNames) {
      state.roleNames = roleNames
    },
  },

  actions: {
    setNeighborId({ commit }, neighborhoodId) {
      commit('SET_NEIGHBOR_ID', neighborhoodId)
    },
    setCommunityId({ commit }, communityId) {
      commit('SET_COMMUNITY_ID', communityId)
    },
    setRoleName({ commit }, roleNames) {
      commit('SET_ROLE_NAME', roleNames)
    },
  }
}

export default user
